package com.qn.pipeline2.config;

import com.qn.pipeline2.FilterChainPipeline;
import com.qn.pipeline2.filters.InputDataPreCheckerFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 管道路由的配置 v2
 *
 * @author QuNing
 * @date 2022/08/30
 */
@Configuration
public class PipelineConfig {

  /**
   * 订单注册pipeline
   * @return
   */
  @Bean
  public FilterChainPipeline orderRegisterPipeline() {
    FilterChainPipeline filterChainPipeline = new FilterChainPipeline();
    filterChainPipeline.addFilter("输入数据校验",inputDataPreCheckerFilter());
    return filterChainPipeline;
  }

  @Bean
  public InputDataPreCheckerFilter inputDataPreCheckerFilter(){
    return new InputDataPreCheckerFilter();
  }

}
